<?php

namespace app\api\Logic;

use app\api\model\ManystoreModel;
use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\exception\DbException;

class ManystoreLogic
{
    /**
     * 教师列表
     * @param $teacherIds
     * @return array
     * @throws DataNotFoundException
     * @throws DbException
     * @throws ModelNotFoundException
     */
    public function teacherListByIds($teacherIds){
        $list = ManystoreModel::whereIn('id',$teacherIds)
            ->where('level',2)
            ->field('id,name')
            ->find();

        return objToArray($list) ?? [];
    }
}
